
<%@page import="qldc.pm.qtht.dmdc.utils.DiaChiUtils"%>
<%@page import="qldc.pm.csdl.cd90.service.CongDanDTOLocalServiceUtil"%>
<%@page import="qldc.pm.csdl.cd90.model.dto.CongDanDTO"%>
<%@ include file="../../init.jsp"%>

 <%
	String soDinhDanhCaNhan = ParamUtil.getString(request, "soDinhDanhCaNhan");
	System.out.println("thong tin chung soDinhDanhCaNhan: >>>"+soDinhDanhCaNhan);
	CongDanDTO congDanDTO = null;
	String _tonGiao="";
	String _danToc ="";
	String _noiSinh = "";
	String _noiThuongTru ="";
	String _noiOHienTai = "";
	String _ngaySinh = "";
	if(Validator.isNotNull(soDinhDanhCaNhan)){
		congDanDTO = CongDanDTOLocalServiceUtil.findBySoDinhDanhCaNhan(soDinhDanhCaNhan);
		if(Validator.isNotNull(congDanDTO)){
			System.out.println("Thong tin chung :"+ congDanDTO.toString());
			qldc.pm.csdl.cd90.model.TonGiao tonGiao = qldc.pm.csdl.cd90.service.TonGiaoLocalServiceUtil.findBySoDinhDanhCaNhan(soDinhDanhCaNhan);
			if(Validator.isNotNull(tonGiao)){
				qldc.pm.qtht.dmdc.model.TonGiao tonGiaoDMCD = qldc.pm.qtht.dmdc.service.TonGiaoLocalServiceUtil.findById(tonGiao.getDmdcTonGiaoId());
				if(Validator.isNotNull(tonGiaoDMCD)){
					_tonGiao = tonGiaoDMCD.getTenTonGiao();
				}
			}
			
			qldc.pm.csdl.cd90.model.DanToc danToc = qldc.pm.csdl.cd90.service.DanTocLocalServiceUtil.findBySoDinhDanhCaNhan(soDinhDanhCaNhan);
			if(Validator.isNotNull(danToc)){
				qldc.pm.qtht.dmdc.model.DanToc danTocDMDC = qldc.pm.qtht.dmdc.service.DanTocLocalServiceUtil.findById(danToc.getDmdcDanTocId());
				if(Validator.isNotNull(danTocDMDC)){
					_danToc = danTocDMDC.getTenDanToc();
				}
			}
			
			_noiSinh = DiaChiUtils.createBlockDiaChi(congDanDTO.getNoiSinhTinhId(), congDanDTO.getNoiSinhQuanHuyenId(), congDanDTO.getNoiSinhPhuongXaId(), congDanDTO.getNoiSinhDiaChi());
			_noiThuongTru = DiaChiUtils.createBlockDiaChi(congDanDTO.getNoiThuongTruTinhId(), congDanDTO.getNoiThuongTruQuanHuyenId(), congDanDTO.getNoiThuongTruPhuongXaId(), congDanDTO.getNoiThuongTruDiaChi());
			_noiOHienTai = DiaChiUtils.createBlockDiaChi(congDanDTO.getNoiOHienTaiTinhId(), congDanDTO.getNoiOHienTaiQuanHuyenId(), congDanDTO.getNoiOHienTaiPhuongXaId(), congDanDTO.getNoiOHienTaiDiaChi());
			
			if(Validator.isNotNull(congDanDTO.getNgaySinh())){
				System.out.println("Thong tin chung :"+ congDanDTO.getNgaySinh());
				_ngaySinh = congDanDTO.getNgaySinh();
			}
			
		}
	}
%>

<div id="<portlet:namespace/>thong-tin-chung-content">
	<table class="gridnormal">
		<tr>
			<td>
				<liferay-ui:message key="ho-va-ten" />
			</td>
			<td>
				 <%= Validator.isNotNull(congDanDTO) ? congDanDTO.getHoVaTen() :"" %> 
			</td>
			<td colspan="3"/>
		</tr>

		 <tr>
			<td>
				<liferay-ui:message key="ho-ten-khac" />
			</td>
			<td>
			</td>
			<td colspan="3"/>

		</tr>

		<tr>
			<td >
				<liferay-ui:message key="anh-chan-dung" />
			</td>
			<td colspan="3"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="gioi-tinh" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) && congDanDTO.getGioiTinh()== 1 ? LanguageUtil.get(portletConfig, request.getLocale(), "nam"): LanguageUtil.get(portletConfig, request.getLocale(), "nu") %>
			</td>
			<td colspan="2"/>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="ton-giao" />
			</td>
			<td>
				<%= _tonGiao %>
			</td>
			<td>
				<liferay-ui:message key="quoc-tich" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) ? congDanDTO.getQuocTich():"" %>
			</td>	
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="dan-toc" />
			</td>
			<td>
				<%=_danToc %>
			</td>
			<td>
				<liferay-ui:message key="loai-doi-tuong" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) ? congDanDTO.getLoaiDoiTuong() :"" %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="ngay-sinh" />
			</td>
			<td>
				<%= _ngaySinh %>
			</td>
			<td>
				<liferay-ui:message key="noi-sinh" />
			</td>
			<td>
				<%= _noiSinh %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="so-cmnd" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) ? congDanDTO.getSoCMND() :"" %>
			</td>
			<td>
				<liferay-ui:message key="so-ho-chieu" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) ? congDanDTO.getSoHoChieu():"" %>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="the-bao-hiem-y-te" />
			</td>
			<td>
				<%= Validator.isNotNull(congDanDTO) ? congDanDTO.getSoTheBaoHiemYTe():""%>
			</td>
			<td>
				<liferay-ui:message key="ms-thue-ca-nhan" />
			</td>
			<td>
				<%=Validator.isNotNull(congDanDTO) ? congDanDTO.getMaSoThueCaNhan() :""%>
			</td>
		</tr>

		<tr>
			<td>
				<liferay-ui:message key="noi-thuong-tru" />
			</td>
			<td colspan="3">
				<%= _noiThuongTru %>
			</td>
		</tr>
		<tr>
			<td>
				<liferay-ui:message key="noi-o-hien-tai" />
			</td>
			<td colspan="3">
				<%=_noiOHienTai %>
			</td>
		</tr>
	</table>
</div>

<script type="text/javascript">
</script>